
/* GENERATED CODE:
 *  Any modifications you make are guaranteed
 *  to be deleted when this is regenerated.
 * Please edit "PROTOCOLS" inside this directory
 *
 * Names are all upper case because of "String" and "string."
 */

using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using OWED.Network.Messages.General;
using OWED.Network.Messages;
using OWED.Network.Messages.Reply;


namespace OWED.Network.Messages.General
{
	public class Proposed: IProtocolItem 
	{
		Date my_date;
		public Proposed (Date date)
		{
			my_date = date;
		}
		public Date Date { get { return my_date; } }


		public static new Proposed FromXml(XmlDocument xml)
		{
			XmlDocument doc;
			if (xml.SelectSingleNode("Proposed/Date") != null) {
				doc = new XmlDocument();
				doc.AppendChild(doc.ImportNode(xml.SelectSingleNode("Proposed/Date"), true));
				Date date = Date.FromXml(doc);

				return new Proposed(date);
			}
			throw new ConnectionException("Bad document supposedly of type:Proposed");
		}


		public override XmlDocument ToXml()		{
			XmlDocument doc = new XmlDocument();

			doc.AppendChild(doc.CreateElement("Proposed"));

			if (my_date != null) {
				XmlNode node;
				node = doc.ImportNode(my_date.ToXml().FirstChild, true);
				doc.FirstChild.AppendChild(node);
			}

			return doc;
		}
	}
}
